import 'dart:math';

/// @Title   单个日期多个点的数据
/// @Author: bryce
/// @CreateDate: 2024年01月21日21:57:01
class ChartMultipleDotData {
  String date; // 日期
  double? value1; // 收入值
  double? value2; // 收入值
  double? value3; // 收入值
  int? xIndex;

  double maxValue() {
    return max(
        value1 ?? double.negativeInfinity, max(value2 ?? double.negativeInfinity, value3 ?? double.negativeInfinity));
  }

  double minValue() {
    return min(value1 ?? double.infinity, min(value2 ?? double.infinity, value3 ?? double.infinity));
  }

  ChartMultipleDotData(this.date, {this.value1, this.value2, this.value3,this.xIndex});

  @override
  String toString() {
    return 'MultipleDotData{date: $date, value1: $value1, value2: $value2, value3: $value3}';
  }
}
